package com.cy.sys.pojo;

import lombok.Data;

import java.io.Serializable;
import java.util.List;
@Data
public class PageObject<T> implements Serializable {
    private static final long serialVersionUID = -4572412539873972338L;
    /**当前页的页码值*/
    private Long pageCurrent;
    /**页面显示记录的条数*/
    private Integer pageSize;
    /**总行数(通过查询获得)*/
    private Long rowCount;
    /**总页数(通过计算获得)*/
    private Long pageCount;
    /**当前页记录*/
    private List<T> records;

    public PageObject(Long pageCurrent,
                      Integer pageSize,
                      Long rowCount,
                      List<T> records) {
        this.pageCurrent = pageCurrent;
        this.pageSize = pageSize;
        this.rowCount = rowCount;
        this.records = records;
        this.pageCount =(rowCount-1)/pageSize+1;

    }
}
